/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import static gestionform.GestionInfos.CHAMP_DATE_NAISS;
import static gestionform.GestionInfos.CHAMP_LOGIN;
import static gestionform.GestionInfos.CHAMP_NOM;
import static gestionform.GestionInfos.CHAMP_PASS;
import static gestionform.GestionInfos.CHAMP_PRENOM;
import static gestionform.GestionInfos.CHAMP_TYPE_UTILISATEUR;
import static gestionform.GestionInfos.getValeurChamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 *
 * @author Paul
 */
public class SaisieUtils {

    private static ArrayList<String> champs;

    public static boolean isNotEmptyLogin(String login) {
        return (!"".equals(login));
    }

    public static boolean isNotEmptyPassword(String password) {
        return (!"".equals(password));
    }

    public static boolean isNotEmptyNom(String nom) {
        return (!"".equals(nom));
    }

    public static boolean isNotEmptyPrenom(String prenom) {
        return (!"".equals(prenom));
    }

    public static boolean isNotEmptyDateNaissance(String dateNaissance) {
        return (!"".equals(dateNaissance));
    }
    
    public static boolean isNotEmptyField(String champ) {
        return (!"".equals(champ));
    }

    /**
     *
     * @param champs
     * @return
     */
    public static boolean isAllNotEmptyFields(String[] champs) {
        boolean ok = true;
        for (String champ : champs) {
            if ("".equals(champ)) {
                ok = false;
            }
        }
        return ok;
    }

    public static boolean isAllNotEmptyFields() {
        boolean ok = true;
        for (String champ : champs) {
            if ("".equals(champ)) {
                ok = false;
            }
        }
        return ok;
    }

    public static List<String> addAllChampsOfCreateAccount(String nom, String prenom, String dateNaissance, String typeUtilisateur, String login, String password) {
        champs = new ArrayList<String>();
        champs.add(nom);
        champs.add(prenom);
        champs.add(dateNaissance);
        champs.add(typeUtilisateur);
        champs.add(login);
        champs.add(password);
        return champs;
    }
}